
// 一. 向量 分量值为2,3,4 少报错 多报错 合并多删减
// 使用的是float类型的分量的向量
//vec2 vec = vec2(12, 2.2);
// 使用boolean类型的分量的向量
//bvec2 bools = bvec2();
// 顶点着色器代码
attribute vec3 position;
attribute float aRandom;

uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;
uniform mediump float u_time;
uniform mediump vec2 u_frequency;

varying float vRandom;

void main() {
    vec4 modelPosition = modelMatrix * vec4(position, 1.0);
    //vRandom = aRandom;
    modelPosition.z += sin(modelPosition.y * u_frequency.y) * 0.1;
    //modelPosition.z = aRandom * 0.9;
    modelPosition.z += sin(modelPosition.y * u_frequency.x) * 0.2;

    gl_Position = projectionMatrix * viewMatrix * modelPosition;
}